<include file="__THEME__/header" />
<style>
.header_bg{display:none;height:0px;}
</style>
<!-- 编辑器样式文件 -->
<link href="__PUBLIC__/js/editor/editor/theme/base-min.css" rel="stylesheet"/>
<!--[if lt IE 8]><!-->
<link href="__PUBLIC__/js/editor/editor/theme/cool/editor-pkg-sprite-min.css" rel="stylesheet"/>
<!--<![endif]-->
<!--[if gte IE 8]><!-->
<link href="__PUBLIC__/js/editor/editor/theme/cool/editor-pkg-min-datauri.css" rel="stylesheet"/>
<!--<![endif]-->
<!-- 全局风格CSS -->
<link href="__THEME__/main.css?20110429" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/js/tbox/box.css" rel="stylesheet" type="text/css" />
<link href="../Public/login.css" rel="stylesheet" type="text/css" />

<script type="text/javascript" src="../Public/js/jquery.sohu.tw.min.0.0.4.js"></script>
<script type="text/javascript" src="../Public/js/tw.new.index.min.0.0.10.js"></script>
<script type="text/javascript" src="../Public/js/slides.min.jquery.js"></script>
<script>
$(document).ready(function(){
	setInterval(function(){
		if('' != $('#email').val())$('#_login_email_label').hide();
		if('' != $('#password').val())$('#_login_password_label').hide();
	}, 100);
});
</script>
<div class="wrap_login">
<div class="login_holder">
	<div class="login_header">
    <div class="quike_reg">
    <span>第一次使用{$ts['site']['site_name']}?</span>
    <a href="{:U('home/Public/register')}" title="立即注册" class="regbtn2"> &nbsp;</a></div>
	<php>if(!$ts['site']['site_logo']){</php>
	<a href="#" class="logo_login" style="background:url(__THEME__/images/logo.png) no-repeat left 0;_background:url(__THEME__/images/logo.gif) no-repeat left 0;"></a>
	<php>}else{</php>
	<a href="#" class="logo_login" style="background:url({$ts['site']['site_logo']}) no-repeat left 0;">&nbsp;</a>
	<php>}</php>
    </div>
</div>
<div class="content_login">
  <div class="main_login">
  <div class="box_login_l" style="background:url({$ts['site']['banner_logo']}) no-repeat left center"></div>
  <div class="login">
    <dl id="ppcontid" class="logform">
        <form action="{:U('home/Public/doLogin')}" method="post">
	       <div class="frm">
	        	<label id="_login_email_label" class="form_label" style="display:block;" onclick="$(this).hide();$('#email').focus();">邮箱</label>
	        	<input type="text" id="email" name="email" class="text" title="邮箱" autocomplete="off" value="" onblur="if($(this).val()=='') $('#_login_email_label').show();" onfocus="$('#_login_email_label').hide();" />
      </div>
          <div class="frm">
              <label id="_login_password_label" class="form_label" style="display:block;" onclick="$(this).hide();$('#password').focus();" >密码</label>
              <input type="password" title="密码" value="" id="password" name="password" class="text" style="display: inline;" onblur="if($(this).val()=='') $('#_login_password_label').show();" onfocus="$('#_login_password_label').hide();" />
          </div>
          <eq name="login_verify_on" value="1">
          <div class="frm">
              <input name="verify" type="text" class="text alM" title="验证码" id="verify" style="width:50px;height:22px;padding:0 3px;" value="" />
              <a href="javascript:void(0);" onclick="changeverify()"><img src="{:U('home/Public/verify')}" id="verifyimg" alt="换一张" class="alM" /></a>
          </div>
          </eq>
          <div class="frm">
         	  <a class="fuc0 right" href="{:U('home/Public/sendPassword')}">忘记密码？</a>
	          <label>
	            <input name="remember" type="checkbox" value="1" />
	            记住登录状态
              </label>
          </div>
	      <div class="frm">
              <input type="submit" value="" class="logbtn hand" />
          </div>
        </form>
        {:Addons::hook('login_input_footer',array('regInfo'=>$regInfo))}
    </dl>
  </div>
</div>
</div>
<include file="__THEME__/footer" />
</div>
<script type="text/javascript">
var since_id = "{$since_id}";

$(function(){
	init();
});

function init() {
	$("ul.tpl").find("li").hover(function(){
		$(this).addClass("hover");
	},function(){
		$(this).removeClass("hover");
	});
	
	$('#slides').slides({
		preload: true,
		//preloadImage: '../Public/images/loading.gif',
		play: 5000,
		pause: 2500,
		hoverPause: true,
		container: "imgb",
		animationStart: function(current){
			$('.caption').animate({
				bottom:-35
			},100);
		},
		animationComplete: function(current){
			$('.caption').animate({
				bottom:0
			},200);
		},
		slidesLoaded: function() {
			$('.caption').animate({
				bottom:0
			},200);
		}
	});
}

setInterval("showRecent()",60000);

function changeverify() {
    var date = new Date();
    var ttime = date.getTime();
    var url = "{:U('home/Public/verify')}";
    $('#verifyimg').attr('src',url+'&'+ttime);
}

function showRecent() {
	$.post("{:U('home/Public/fetchNew')}", {since_id:since_id}, function(txt){
		if (txt != 0) {
			var obj = eval('(' + txt + ')');
			var html = '';
			html += '<div class="lineD_btm pm10 mt10 pb5" id="weibo_'+obj.weibo_id+'">';
	        html += '<div class="userPic">'+obj.user_pic+'</div>';
	        html += '<div style="margin-left:70px"><div style="min-height: 33px;_height:33px; _overflow:visible;"><strong>'+obj.uname+': </strong><span class="ugc">'+obj.content+'</span></div>';
	        html += '<div class="mt10">';
	        html += '<em title="'+obj.friendly_date+'" class="tm">'+obj.friendly_date+'</em>';
	        html += '</div>';
	        $('#tw_content').prepend(html);
	        since_id = obj.id;
		}
	});
}
</script>
